/********************************************************************
	created:	2013/01/02
	created:	2:1:2013   1:21
	filename: 	e:\Code\DataStructure\Code\DataStructure\LinkedList.h
	file path:	e:\Code\DataStructure\Code\DataStructure
	file base:	LinkedList
	file ext:	h
	author:		DianWang
	
	purpose:	Doubly LinkedList
*********************************************************************/
#pragma once
#include "Macro.h"
#include "Struct.h"

class CLinkedList
{
public:
    CLinkedList(void);
    ~CLinkedList(void);

public:
    void Append(const Data& data);
    bool Insert(const Data& data, int key);
    bool Set(const Data& data);
    bool Delete(int key);
    void Clear();

    bool Prior(Data& data, int key);
    bool Next(Data& data, int key);
    bool Get(Data& data, int key);
    bool Get(Data& data);
    int GetSize();
    bool IsEmpty();

#ifdef _DEBUG
    void Print();
#endif

private:
    NodeEx* Get(int key);

private:
    NodeEx* m_head;
    int m_size;
};

